home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
-
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
- <xsl:output method="html"/>
-
- <xsl:variable name="common-styles">
- <style type="text/css">
- html { border: 6px solid gray; }
- body { background-color: white; color: black; font: 84% Verdana, Arial, sans-serif; margin: 12px 22px; }
- a { color: #0002CA; }
- a:hover { color: #6B8ADE; text-decoration: underline; }
- span.nodescription { color: silver; font-size: smaller; }
-
- /* override headings used by feeds */
- h1,h2,h3,h4,h5,h6 { font-size: 80%; font-weight: bold; font-style: italic; }
-
- div.favchannel {
- overflow: hidden;
- /*filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#D6DFF7,endColorStr=#EEF5FC);*/
- border: 1px solid #6B8ADE;
- background-color: #D6DFF7;
- float: left;
- margin: 0 14px 10px 0;
- padding: 16px 16px 0 16px; width: 40%;
- }
-
- div.newspapertitle { font-weight: bold; font-size: 120%; text-align: center; padding-bottom: 12px; text-transform: uppercase; }
- div.channel { border-bottom: 1px dotted silver; margin-top: 14px}
- div.channeltitle { font-weight: bold; text-transform: uppercase; margin-top: 12px; margin-bottom: 18px;}
- img.channel { border: none; }
-
- div.newsitemcontent { line-height: 140%; }
- div.newsitemcontent ol, div.newsitemcontent ul { list-style-position: inside;}
- div.newsitemtitle { font-weight: bold; margin-bottom: 8px }
- div.newsitemfooter { color: gray; font-size: xx-small; text-align: left; margin-top: 6px; margin-bottom: 18px; }
-
- div.newsitemtitle a, div.newsitemcontent a, div.newsitemfooter a { text-decoration: none; }
- </style>
- </xsl:variable>
-
- <!-- channel group newspaper -->
- <xsl:template match="newspaper[@type='group']">
- <html>
- <head>
- <title>Group Newspaper</title>
- <xsl:copy-of select="$common-styles"/>
- <style>
- div.channeltitle a, div.newsitemtitle a { color: black; }
- </style>
- </head>
- <body>
- <div class="newspapertitle"><xsl:value-of select="title" disable-output-escaping="yes"/></div>
-
- <!-- loop through each channel -->
- <xsl:for-each select="channel">
- <xsl:variable name="chanlink" select="link"/>
- <xsl:variable name="chantitle"/>
-
- <!-- determine the class based on whether this is the 'favorite' channel -->
- <div>
- <xsl:attribute name="class">
- <xsl:choose>
- <xsl:when test="@favorite">
- <xsl:text>favchannel</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>channel</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
-
- <div class="channeltitle">
- <!-- channel image -->
- <xsl:if test="image">
- <xsl:variable name="imgurl" select="image/url"/>
- <xsl:variable name="imgtitle" select="image/title"/>
- <xsl:variable name="imglink" select="image/link"/>
- <a href="{$imglink}"><img class="channel" src="{$imgurl}" alt="{$imgtitle}" align="right" style="margin-left: 8px"/></a>
- </xsl:if>
- <!-- channel title -->
- <a href="{$chanlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
- </div>
-
- <!-- loop through each news item -->
- <xsl:for-each select="item">
- <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
- <div class="newsitemtitle">
- <xsl:variable name="itemlink" select="link"/>
- <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
- </div>
- <div class="newsitemcontent">
- <xsl:value-of select="description" disable-output-escaping="yes"/>
- </div>
- <div class="newsitemfooter"><xsl:value-of select="fd:dateDisplay"/></div>
- </xsl:for-each>
- </div> <!-- close the channel div -->
- </xsl:for-each>
- </body>
- </html>
- </xsl:template>
-
- <!-- channel newspaper -->
- <xsl:template match="newspaper[@type='channel']">
- <html>
- <head>
- <title>Channel Newspaper</title>
- <xsl:copy-of select="$common-styles"/>
- <style>
- div.newspapertitle { margin-bottom: 12px; border-bottom: 1px dashed silver; }
- </style>
- </head>
- <body>
- <div class="newspapertitle">
- <!-- channel title -->
- <xsl:value-of select="title" disable-output-escaping="yes"/>
- <!-- channel image -->
- <xsl:if test="channel/image">
- <xsl:variable name="imgurl" select="channel/image/url"/>
- <xsl:variable name="imgtitle" select="channel/image/title"/>
- <xsl:variable name="imglink" select="channel/image/link"/>
- <br/>
- <a href="{$imglink}"><img class="channel" src="{$imgurl}" alt="{$imgtitle}" align="bottom" style="margin-top: 8px;"/></a>
- </xsl:if>
- </div>
-
- <!-- loop through each news item -->
- <xsl:for-each select="channel/item">
- <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
- <div class="newsitemtitle">
- <xsl:variable name="itemlink" select="link"/>
- <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
- </div>
- <div class="newsitemcontent">
- <xsl:value-of select="description" disable-output-escaping="yes"/>
- </div>
- <div class="newsitemfooter">
- <xsl:value-of select="fd:dateDisplay"/>
- </div>
- </xsl:for-each>
-
- </body>
- </html>
- </xsl:template>
-
- <!-- single news item -->
- <xsl:template match="newspaper[@type='newsitem']">
- <html>
- <head>
- <title>News Item</title>
- <xsl:copy-of select="$common-styles"/>
- <style>
- div.newsitemtitle { border-bottom: 1px dotted silver; margin-bottom: 10px; padding-bottom: 10px;}
- div.newsitemfooter { text-align: right; margin-top: 14px; padding-top: 6px; border-top: 1px dashed #CBCBCB; }
- </style>
- </head>
- <body>
- <xsl:for-each select="channel/item">
- <div class="newsitemtitle">
- <xsl:variable name="itemlink" select="link"/>
- <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
- </div>
- <div class="newsitemcontent">
- <xsl:value-of select="description" disable-output-escaping="yes"/>
- </div>
- <div class="newsitemfooter">
- <!--
- Important: use 'source' element here so that source channel shows for
- newsbins and watches. For other channels, FeedDemon sets the source
- to the channel itself.
- -->
- <xsl:variable name="srclink" select="source/@htmlUrl"/>
- <a href="{$srclink}"><xsl:value-of select="source"/></a>
- <!-- add link to comments if available -->
- <xsl:if test="comments">
- <xsl:variable name="commentlink" select="comments"/>
- <xsl:variable name="commentimg" select="'$IMAGEDIR$comments.gif'"/>
- <a href="{$commentlink}"><img src="{$commentimg}" border="0" hspace="6"/></a>
- </xsl:if>
- <!-- add link to enclosure if available -->
- <xsl:if test="enclosure">
- <xsl:variable name="enclosurelink" select="enclosure/@url"/>
- <xsl:variable name="enclosureimg" select="'$IMAGEDIR$enclosure.gif'"/>
- <a href="{$enclosurelink}"><img src="{$enclosureimg}" border="0" hspace="6"/></a>
- </xsl:if>
- <br />
- <xsl:value-of select="fd:dateDisplay"/>
- </div>
- </xsl:for-each>
-
- </body>
- </html>
- </xsl:template>
-
- </xsl:stylesheet>